from django.db import models

# Create your models here.

class WorkOrder(models.Model):
    STATUS = [
        (1, "待审核"),
        (2, "维修中"),
        (3, "已完成"),
    ]
    uid = models.IntegerField(default=0)
    rid = models.IntegerField(default=0)
    worker = models.IntegerField(default=0)
    status = models.IntegerField(default=1, choices=STATUS)
    info = models.TextField(null=True)
    type = models.IntegerField(null=True)

    def get_info(self):
        dic = dict()
        dic['wid'] = self.id
        dic['uid'] = self.uid
        dic['rid'] = self.rid
        dic['status'] = self.status
        dic['worker'] = self.worker
        dic['info'] = self.info
        dic['type'] = self.type
        return dic
